/******************************************************************************
*  Copyright(c) 2021-2023 Sietium
*
*  @file:    Node.cpp
*  @brif:    uniform interface
*
*  @date:    05/10/2021
*  @Author:  cary.Zhang
*  @details:
*
******************************************************************************/
#include <sstream>
#include "Node.h"

Node::Node()
{
    averageFps = 0.0;
}

Node::NodeType Node::getNodeType()
{
    return NodeType_Generic;
}

std::string Node::getNodeTypeStringByType(Node::NodeType type)
{
    switch (type) {
        case NodeType_Generic:
            return "Generic";
        case NodeType_FillRate:
            return "FillRate";
        default:
            return "Undefined";
    }
}

void Node::setWeightValue(int weight)
{
    weightValue = std::min(Node::MAX_WEIGHT, std::max(weight, Node::MIN_WEIGHT));
}

int Node::getWeightValue()
{
    return weightValue;
}

void Node::setAverageFps(double fps)
{
    averageFps = fps;
}

double Node::getAverageFps() const
{
    return averageFps;
}

std::string Node::getNodeName() const
{
    return nodeName;
}

std::string Node::getNodeTitle()
{
    std::stringstream stream;
    stream << "GPU-Perf for Vulkan - case: " << getNodeName();
    return stream.str();
}

bool Node::checkDevice(const VkPhysicalDeviceFeatures &feature)
{
    (void)feature;
    return true;
}
